/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BO;

import Bean.BookBean;
import Mapper.BookMapper;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author Quang Thao
 */
public class BookBO {

    public List GetAll() throws Exception {
        Mapper.BookMapper map = new BookMapper();
        List list = map.GetAll();
        map.closeConnection();
        return list;
    }

    public List GetAll(String type) throws Exception {
        Mapper.BookMapper map = new BookMapper();
        List list = map.GetAll(type);
        map.closeConnection();
        return list;
    }

    public Bean.BookBean GetInfo(String isbn) throws Exception {
        Mapper.BookMapper map = new BookMapper();
        Bean.BookBean bkbean = map.GetInfo(isbn);
        map.closeConnection();
        return bkbean;
    }

    public List GetListBySpecial(String special) throws Exception {
        Mapper.BookMapper map = new BookMapper();
        List list = map.GetListBySpecial(special);
        map.closeConnection();
        return list;
    }
    public boolean IsExist(Bean.BookBean bk) throws Exception
    {
        Mapper.BookMapper map = new Mapper.BookMapper();
        boolean found = map.IsExist(bk);
        map.closeConnection();
        return found;
    }
    public int Add(Bean.BookBean bk) throws Exception
    {
        Mapper.BookMapper map = new Mapper.BookMapper();
        int update = map.Add(bk);
        map.closeConnection();
        return update;
    }
    public int Delete(BookBean bk) throws Exception {
        Mapper.BookMapper map = new Mapper.BookMapper();
        int update = map.Delete(bk);
        map.closeConnection();
        return update;
    }
}
